package chpt01;

import java.util.Scanner;
import java.lang.String;
import java.lang.Integer;

public class FloatAdd {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		while(input.hasNext()){
			String in=input.next();
			char ch[]=in.toCharArray();
			String s="";
	        for(int i=0;i<ch.length;i++){
	        	if(ch[i]>='0'&&ch[i]<='9'){
	        		s+=ch[i];
	        	}
	        }
	        int x = Integer.parseInt(s,10);
	        int sum=0;
	        x=x>0?x:-x;
	        while(x!=0){
	        	int a=x%10;
	        	sum=sum+a;
	        	x=x/10;
	        }
	        System.out.println(sum);  
		}
		input.close();
	}
}